class Base {
  static Input = 'Input';
  static InputNumber = 'InputNumber';
  static InputGroup = 'InputGroup';
  static InputTextArea = 'InputTextArea';
  static InputPassword = 'InputPassword';
  static InputCountDown = 'InputCountDown';
  static Select = 'Select';
  static RadioGroup = 'RadioGroup';
  static CheckboxGroup = 'CheckboxGroup';
  static Cascader = 'Cascader';
  static DatePicker = 'DatePicker';
  static MonthPicker = 'MonthPicker';
  static RangePicker = 'RangePicker';
  static TimePicker = 'TimePicker';
  static WeekPicker = 'WeekPicker';
  static Switch = 'Switch';
  static Upload = 'Upload';
  static StrengthMeter = 'StrengthMeter';
  static Slider = 'Slider';
  static Rate = 'Rate';
  static Divider = 'Divider';

  protected _params: object = {};
  set params(params: object) {
    this._params = params ? params : {};
  }
  get params() {
    return this._params;
  }
  protected _field: string = '';
  protected _label: string = '';
  protected _value: any = '';
  protected _type: string = '';
  protected _type: string = '';
  protected _placeholder: string = '';
  protected _disabled: boolean = false;
  protected _required: boolean = true;
  protected _help: string = '';
  constructor(field: string, label: string, value: any) {
    this.field = field;
    this.label = label;
    this.value = value === 'undefined' ? '' : value;
  }
  set field(field: string = '') {
    this._field = field;
    return this;
  }
  get field(): string {
    return this._field;
  }

  set label(label: string = '') {
    this._label = label;
    return this;
  }
  get label() {
    return this._label;
  }

  set value(value: any = '') {
    this._value = value;
    return this;
  }
  get value() {
    return this._value;
  }

  set type(type: string = '') {
    this._type = type;
    return this;
  }
  get type() {
    return this._type;
  }

  set disabled(disabled: boolean = false) {
    this._disabled = disabled === true ? true : false;
    return this;
  }
  get disabled() {
    return this._disabled;
  }

  set required(required: boolean = false) {
    this._required = required === true ? true : false;
    return this;
  }
  get required() {
    return this._required;
  }

  set options(options: Array<any>) {
    this._options = options;
    return this;
  }
  get options() {
    return this._options;
  }

  set help(message: string) {
    this._help = message;
    return this;
  }
  get help() {
    return this._help;
  }

  /**
   * 可以设置一个字符串，可以设置一个数组，RangePicker日期范围的时候使用
   * @param {Object} placeholder
   */
  setPlaceHolder(placeholder) {
    this._placeholder = placeholder;
  }
}

export default Base;
